package com.fm.webrtc.message;

import org.json.JSONException;
import org.json.JSONObject;

public class SdpMessage {
    private String type;
    private String sdp;

    public SdpMessage(String type, String sdp){
        this.type = type;
        this.sdp = sdp;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getSdp() {
        return sdp;
    }

    public void setSdp(String sdp) {
        this.sdp = sdp;
    }

    public JSONObject toJson() throws JSONException {
        JSONObject jsonObject = new JSONObject();
        jsonObject.put("type", type);
        jsonObject.put("sdp", sdp);
        return jsonObject;
    }

    @Override
    public String toString() {
        return "SdpMessage{" +
                "type='" + type + '\'' +
                ", sdp='" + sdp + '\'' +
                '}';
    }
}
